import React, { useState, memo, useEffect, useMemo, useRef } from 'react';
import { Input } from 'antd';
import { useModel } from "umi"
import ReactECharts from 'echarts-for-react';
import { useAsyncEffect } from 'ahooks';


function Radarchart({ content, setconfig, option, style }) {
    const [rerender, setrerender] = useState(true);
    const [neop, setneop] = useState(option);

    useAsyncEffect(async () => {
        setneop(option);
    }, [option])


    return (
        <div
            style={{ margin: 0, width: "100%", height: "100%" }}
        >
            {rerender && <ReactECharts
                option={neop ?? {}}
                notMerge={true}
                lazyUpdate={true}
                opts={{renderer: 'svg'}}
            />}
        </div>
    );
}

export default memo(Radarchart);